<template>
  <div>
    <!-- <router-view /> -->
    <router-view v-slot="{ Component }">
      <transition name="slide-fade" mode="out-in">
        <keep-alive>
          <component  :is="Component" :key="$route.name" v-if="$route.meta.keepAlive"/>
        </keep-alive>
      </transition>   
      <transition name="slide-fade" mode="out-in">
        <component :is="Component" v-if="!$route.meta.keepAlive" />
      </transition> 
    </router-view>
  </div>
</template>
<style type="text/css">
  .slide-fade-enter-active {
    transition: all 0.3s ease-out;
  }
  .slide-fade-leave-active {
    transition: all 0.3s cubic-bezier(1, 0.2, 0.8, 1);
  }
  .slide-fade-enter-to {
    transform: translateX(0px);
    opacity: 1;
  }
  .slide-fade-enter-from,
  .slide-fade-leave-to {
    transform: translateX(-50px);
    opacity: 0;
  }
</style>
